<template>
  <FileList mode="share"></FileList>
</template>

<script setup>
import { useI18nStore, useFileStore, useFlagStore } from '@/stores'

const fileStore = useFileStore()
const i18nStore = useI18nStore()
const flagStore = useFlagStore()

watchEffect(() => {
  if (fileStore.curFolderId === 0) {
    fileStore.setCurFolderInfo({
      folder_id: 0,
      name: i18nStore.translate('public_files')
    })
  }
})

async function fetchData() {
  flagStore.setFileListLoading(true)
  await fileStore.entryFolder(0)
  flagStore.setFileListLoading(false)
}
onMounted(() => {
  fetchData()
})
</script>

<style scoped lang="scss">
@import './index.scss';
</style>
